package com.chixing.day12_date_factory.factory;

public class TestFactory {
    public static void main(String[] args) {
        PhoneFactory factory = new PhoneFactory();
        Phone phone1 = factory.getPhone("huawei");
        //Phone是接口, 只有方法的定义，没有方法的实现
        //具体call(),sendMsg(),takePhoto() 实现 都【封装在】 实现子类中
        //可以保护业务内部实现的安全性
        phone1.call();
        phone1.sendMsg();
        phone1.takePhoto();

        PhoneFactory factory1 = new PhoneFactory();
        Phone phone2 = factory1.getPhone("oppo");
        phone2.call();

    }
}
